package com.jt.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

//http://localhost:8080/get
@RestController
@PropertySource(value="classpath:/mysql.properties",encoding = "UTF-8")
public class JDBCController {
    @Value("${mysql.username}")
    String username;
    @Value("${mysql.password}")
    String password;
    @RequestMapping("get")
    public String getMsg(){
        return username+password;
    }

    //http://localhost:8080/get2
    @Value("${mysql.username2}")
    String username2;
    @Value("${mysql.password2}")
    String password2;
    @RequestMapping("get2")
    public String getMsg2(){
        return username2+password2;
    }
}
